import { myAjax } from '@/utils/ajax'

/**
 * 获取账户列表数据
 */
export function getAccountList (data, options = {}) {
  return myAjax({
    method: 'post',
    url: '/system/user/get_user_list',
    data: data,
    ...options
  })
}

/**
 * 删除账户
 * @param {number} accountId 账户ID
 */
export function delAccount (accountId) {
  return myAjax({
    url: '/system/user/delete_user',
    data: {
      fid: accountId
    }
  })
}

/**
 * 获取账户角色
 * @param {number} accountId 账户ID
 */
export function getAccountRoles (accountId) {
  return myAjax({
    url: '/system/user/get_roles_for_user',
    data: {
      userId: accountId
    }
  })
}

/**
 * 保存账户信息
 */
export function saveAccountInfo (data) {
  return myAjax({
    method: 'post',
    url: '/system/user/save_user',
    data: data
  })
}
